package com.ck.hxc.config.enums;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

/**
 * @author hxc
 * @since 2024/10/25 21:50
 */
public enum AuthEnums {

    API_SWAGGER_1("/swagger-ui/index.html"),
    API_SWAGGER_3("/swagger-ui/index.css"),///swagger-ui/swagger-ui.css
    API_SWAGGER_4("/swagger-ui.html/**"),///swagger-ui/index.html
    API_SWAGGER_5("/swagger-ui/swagger-ui.css"),
    API_SWAGGER_6("/swagger-ui/**"),
    API_SWAGGER_7("/doc.html/**"),
    API_SWAGGER_11("/doc.html#/**"),
    API_SWAGGER_8("/api-docs/**"),
    API_SWAGGER_9("/favicon.ico"),
    API_SWAGGER_10("/v3/api-docs/swagger-config"),

    CONNECT("/sse/createConnect"),

    /**
     * 网关限制，放行地址:登录
     */
    LOGIN("/sysUser/login");




    private final String context;

    AuthEnums(String context) {
        this.context = context;
    }


    public static boolean authPath(String path) {
        return AUTH.contains(path);
    }

    public final static List<String> AUTH = new ArrayList<>();

    static {
        Stream.of(AuthEnums.values()).forEach(e -> AuthEnums.AUTH.add(e.context));
    }


}
